<?php

use Biz\service\trade\Order as sOrder;

class CancelOrderAction extends ActionPlugin
{
    const USER_LEVEL = self::LEVEL_REGISTER;

    public function main()
    {
        $orderNo = $this->getRequest()->getPost('order_no', '');
        $reasonId = $this->getRequest()->getPost('reason_id', '0');


        $result = sOrder::cancelOrder($orderNo, $this->uid,false,$reasonId);

        if (!empty($result['tip_msg'])) {
            $this->setSuccess($result, self::API_CODE_SUCCES, self::TOSAT_PREFIX . $result['tip_msg']);

        } else {
            $this->setSuccess($result);
        }
    }

}